package com.dd.cloud.user.entity.chknowl;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 古籍目录表
 * </p>
 *
 * @author czg
 * @since 2022-07-04
 */
@Data
@EqualsAndHashCode
@Accessors(chain = true)
@Table(comment = "书籍目录")
public class ChknowlBooksCtlg implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @Column(isKey = true, isAutoIncrement = true)
    private Integer id;

    /**
     * 古籍id
     */
    @Column(comment = "古籍id", length = 32)
    private Integer bookId;

    /**
     * 章节/目录名
     */
    @Column(comment = "章节/小节名", length = 128)
    private String name;

    /**
     * 层级
     */
    @Column(comment = "层级", length = 32)
    private Integer rank;

    /**
     * 父级id 一级pid为0
     */
    @Column(comment = "父级id", length = 32)
    private Integer pid;

    /**
     * 排序
     */
    @Column(comment = "章节/小节顺序")
    private Integer sort;


    /**
     * 状态 1正常 -1删除
     */
    @Column(comment = "状态 1正常 -1删除")
    private Integer status;

    /**
     * 创建时间
     */
    @Column(comment = "创建时间")
    private LocalDateTime createDate;

    /**
     * 子集
     */
    @TableField(exist = false)
    private List<ChknowlBooksCtlg> sonMenus;


}
